#ifndef __KPF_SOCKET_H__
#define __KPF_SOCKET_H__

#include "net_api.h"

#include "KPF_Addr.h"

typedef enum C_KPF_SOCKET_TYPE_T
{
	KPF_SOCKET_TYPE_UDP, 
	KPF_SOCKET_TYPE_TCP, 
	KPF_SOCKET_TYPE_MULTICAST
}C_KPF_SOCKET_TYPE;

class KPF_Socket
{
public:
	KPF_Socket( void );

	KPF_Socket( C_SOCKET_TYPE eType );
	
	KPF_Socket( CSocket *pSocket );
	
	virtual ~KPF_Socket( void );
	
	KPF_Socket &operator =( const KPF_Socket &other );
	
	void setSocket( const CSocket *pSocket );
	
	const CSocket *getSocket( void );
	
	int32_t Send( const int8u_t *pData, const int32_t iDataLen );
	int32_t Recv( int8u_t *pDataBuf, const int32_t iDataBufLen );
	
	int32_t Sendto( const int8u_t *pData, const int32_t iDataLen, KPF_Addr *pAddr = NULL );
	int32_t Recvfrom( int8u_t *pDataBuf, const int32_t iDataBufLen, KPF_Addr *pAddr = NULL );
protected:

private:
	const CSocket *pm_Socket;
};

#endif
